package cn.thoughtworks.school.usercenter.repositories;

import ch.qos.logback.core.util.OptionHelper;
import cn.thoughtworks.school.usercenter.entities.User;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;


public interface UserRepository extends JpaRepository<User, Long> {
    List<User> getUserByEmail(String email);

    User findByEmail(String email);

    List<User> getUserByUsername(String userName);

    List<User> getAllByIdIn(List<Long> ids);

    List<User> getUserByMobilePhone(String mobilePhone);

    List<User> getUserByUsernameContainingOrEmailContaining(String username, String email, Pageable pageable);

    List<User> getAllByUsernameInOrEmailIn(List<String> usernameList, List<String> emailList);

    User findByUsername(String username);

    User findByMobilePhone(String phone);

    List<User> getUserByUsernameContaining(String query, Pageable topTen);

    List<User> findByUsernameIn(List<String> userNames);

    List<User> findByEmailIn(List<String> emails);
}
